import Router from '@koa/router'
import {
    deleteUserByIdController,
    getUserPageController,
    postUserController,
    putUserByIdController,
} from '../controllers/user'

const userRouter = new Router({
    prefix: '/user',
})

// 用户的增删改查
userRouter.get('/', getUserPageController) // 获取用户列表
userRouter.post('/', postUserController) // 添加用户
userRouter.put('/:id', putUserByIdController) // 修改用户信息
userRouter.delete('/:id', deleteUserByIdController) // 删除用户

export default userRouter
